import Vue from 'vue'
import Router from 'vue-router'
const home = r => require.ensure([], () => r(require('@/views/home/index')), 'home')
const stock = r => require.ensure([], () => r(require('@/views/stock/index')), 'stock')
const about = r => require.ensure([], () => r(require('@/views/home/children/about/index')), 'about')

Vue.use(Router)

export default new Router({
    //mode: 'history',
    routes: [{
            path: '*',
            redirect: '/home'
        },
        {
            path: '/home',
            name: 'home',
            component: home,
            children: [{
                path: '/home/about',
                name: 'about',
                component: about
            }]
        },
        {
            path: '/stock',
            name: 'stock',
            component: stock
        }

    ]
})